package br.edu.fanor.esfinge.dao.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.edu.fanor.esfinge.dao.EditoraDAO;
import br.edu.fanor.esfinge.entity.Editora;

@Stateless(mappedName="ejb/EditoraDAO")
public class EditoraDAOImpl implements EditoraDAO {

	@PersistenceContext
	public EntityManager emr;
	
	@Override
	public Editora inserir(Editora editora) {
		emr.persist(editora);
		return editora;
	}

	@Override
	public Editora buscarId(long id) {
		return emr.find(Editora.class, id);
	}

	@Override
	public void remover(Editora editora) {
		emr.remove(editora);
		
	}
	

}
